home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / UTIL / CD Playthrough 1.5.sit / CD Playthrough 1.5 / Source / SoundIn.c < prev    next >
Text File  |  1996-11-20  |  1KB  |  47 lines

  1. //    CD Playthrough
  2. //    Version: 1.5 <October 3, 1994>
  3. //    (c)    1994 neg.active.productions, jwang@csua.berkeley.edu <James    Wang>  
  4. //    ftp://ftp.csua.berkeley.edu/pub/jwang/cool/cd-playthrough-15.hqx
  5.  
  6. //    File:            SoundIn.c
  7. //
  8. //    Contains:        Sound input sub-routines
  9. //
  10. //    Written by:        Gary Anwyl, James Wang
  11. //
  12. //    Description:    Opens the default input device (0), gets and sets
  13. //                    both the input source ('sour') and playthrough ('plth')
  14. //                    options via standard information selectors.
  15.  
  16.  
  17. #include "main.h"
  18.  
  19.  
  20. void get_sound_in(SoundSetting *mySnd)
  21. {
  22.     long    siRefNum;
  23.     OSErr    err;
  24.  
  25.     err = SPBOpenDevice(0, siReadPermission, &siRefNum);
  26.     if (err) stop_alert(siReadDevFailed);
  27.     err = SPBGetDeviceInfo(siRefNum, 'plth', (Ptr) &(mySnd->siCurrPlth));
  28.     err = SPBGetDeviceInfo(siRefNum, 'sour', (Ptr) &(mySnd->siCurrSour));
  29.     if (err) stop_alert(siGetDevInfoFailed);
  30.  
  31.     SPBCloseDevice(siRefNum);
  32. }
  33.  
  34. void set_sound_in(SoundSetting *mySnd)
  35. {
  36.     long    siRefNum;
  37.     OSErr    err;
  38.  
  39.     err = SPBOpenDevice(0, siWritePermission, &siRefNum);
  40.     if (err) stop_alert(siWriteDevFailed);
  41.     err = SPBSetDeviceInfo(siRefNum, 'plth', (Ptr) &(mySnd->siWantPlth));
  42.     err = SPBSetDeviceInfo(siRefNum, 'sour', (Ptr) &(mySnd->siWantSour));
  43.     if (err) stop_alert(siSetDevInfoFailed);
  44.  
  45.     SPBCloseDevice(siRefNum);
  46. }
  47.